package com.infore.authorityManagement.entity;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @ClassName: SysPermission
 * @Description: 权限表 实体类
 * @author 谭红波
 * @date 2017年9月12日
 */
@Entity
@Table(name = "sys_permission")
public class SysPermission implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "permission_id")
    private String permissionId; // 权限id
    
    @Column(name = "app_id")
    private String appId; // 应用系统ID
   
    @Column(name = "app_name")
    private String appName; // 应用系统名称
    
    @Column(name = "app_code")
    private String appCode; // 应用系统代码

    @Column(name = "permission_name")
    private String permissionName; // 权限名称

    @Column(name = "url")
    private String url; // 权限 url
    
    @Column(name = "action")
    private String action;	//操作权限，分为GET,PUT,POST,DELETE

    @Column(name = "seq_num")
    private Integer seqNum; // 序号

    @Column(name = "PERMISSION_PARENT_ID")
    private String permissionParentID; // 父权限ID

    /*@OneToMany(fetch = FetchType.EAGER, mappedBy = "permissionParentID", cascade = {CascadeType.REMOVE })
    Set<SysPermission> childrens;*/

    @Column(name = "PERMISSION_LEVEL")
    private Integer permissionLevel; // 菜单权限级别

    @Column(name = "PERMISSION_PICTURE_URL")
    private String permissionPictureUrl; // 菜单权限图标地址 或样式

    @Column(name = "create_time")
    private Timestamp createTime; // 创建时间

    @Column(name = "create_userid")
    private String createUserId; // 创建人

    @Column(name = "permission_type")
    private Integer permissionType; // 权限类型 0标识功能，1表示菜单

    @Column(name = "description")
    private String description; // 描述

    @Column(name = "STATUS")
    private Integer status; // 是否开放 0暂未开放 1或null 默认开放
    
    @Transient
    private Integer checked;

    public String getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(String permissionId) {
        this.permissionId = permissionId;
    }


	public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getAppCode() {
        return appCode;
    }

    public void setAppCode(String appCode) {
        this.appCode = appCode;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public Integer getSeqNum() {
        return seqNum;
    }

    public void setSeqNum(Integer seqNum) {
        this.seqNum = seqNum;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public Integer getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(Integer permissionType) {
        this.permissionType = permissionType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPermissionParentID() {
        return permissionParentID;
    }

    public void setPermissionParentID(String permissionParentID) {
        this.permissionParentID = permissionParentID;
    }

    public Integer getPermissionLevel() {
        return permissionLevel;
    }

    public void setPermissionLevel(Integer permissionLevel) {
        this.permissionLevel = permissionLevel;
    }

    public String getPermissionPictureUrl() {
        return permissionPictureUrl;
    }

    public void setPermissionPictureUrl(String permissionPictureUrl) {
        this.permissionPictureUrl = permissionPictureUrl;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getChecked() {
        if (checked == null) {
            checked = 0;
        }
        return checked;
    }

    public void setChecked(Integer checked) {
        this.checked = checked;
    }




}
